package com.jdd.fintech.morse.test;

import com.jddglobal.filter.support.exception.FilterException;
import com.wangyin.aks.security.sign.SignEnvelopService;
import com.wangyin.aks.security.sign.SignEnvelopServiceImpl;
import org.apache.commons.codec.binary.Base64;
import org.junit.Test;
import org.springframework.util.Base64Utils;

import javax.crypto.Cipher;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.security.*;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.HashMap;
import java.util.Map;

import static com.jdd.fintech.morse.plugin.util.RSAUtil.publicRsaEncryptAdnDecrypt;
import static com.jdd.fintech.morse.plugin.util.RSAUtil.wyaksRSA;

public class RSAUtilTest extends AppTest{

    @Test
    public void testWangYingRsaEncryptAdnDecrypt() throws FilterException {
        //网银.AKS.RSA加解密
        wyaksRSA();
    }

    @Test
    public void testCommonRsaEncryptAdnDecrypt() throws Exception {
        //公共RSA通用加解密
        publicRsaEncryptAdnDecrypt();
    }
}
